import React, { Component } from 'react'
import PupSub from 'pubsub-js'

export default class Lists extends Component {
    componentDidMount() {
        PupSub.subscribe("guigu", (msg, data) => {
            console.log(data)
        })
    }
    render() {
        let userData = this.props.userData;
        return (
            <div className="lists">
                {
                    userData.map((item) => {
                        return (
                            <div key={item.id} className="item">
                                <img src={item.avatar_url} alt="" />
                                <p>{item.id}</p>
                            </div>
                        )
                    })
                }
            </div>
        )
    }
}